<?php
require "model/new.model.php";
session_start();
if(isset($_SESSION['username'])){
 $id = $_POST["id"];
 $title = $_POST["title"];
 $author = $_POST["author"];
 $content = $_POST["content"];
 $kid = $_POST["modules"];
 $content = htmlspecialchars($content,ENT_QUOTES);  

 $tr = newList::editnew($title,$author,$kid,$content,$id);
 if($tr){
    
    echo "<script>alert('修改成功');parent.location.href='./new.php';</script>";
 }
 else{
   
    echo "<script>alert('修改失败');parent.location.href='./newedit2.php?id=$id';</script>";
 }
}else{
    header("Location:../log.php");
    exit();
}




?>
